package yuan;

import org.openjdk.jol.info.ClassLayout;

import java.util.*;
import java.util.stream.Stream;

/**
 * @version: 1.0
 * @Description: TODO
 * @author: zZmH
 * @date: 2020/09/14 16:38
 */


public class User {

    private int a;

    public User() {
    }

    public User(int a) {
        this.a = a;

    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return a == user.a;
    }

    @Override
    public int hashCode() {
        return Objects.hash(a);
    }

    @Override
    public String toString() {
        return "User{" +
                "a=" + a +
                '}';
    }

    public void setA(int a) {
        this.a = a;
    }

    public static void main(String[] args) {
        /*User user = new User(1,2,3,4,5,6,7);
        ClassLayout classLayout = ClassLayout.parseInstance(user);
        System.out.println(classLayout);
        List<String> myList = Arrays.asList("1", "2", "3");
        myList.stream()
                .sorted(Comparator.comparingInt(Integer::parseInt))
                .forEach(System.out::println) ;*/

        User user = new User(1);
        HashMap<String, User> map = new HashMap<>();
        User a = map.put("a", user);
        System.out.println(map.get("a"));

    }

}
